package org.kms.Controllers;

import org.kms.dao.dicDao;
import org.kms.dao.dictionaryDao;
import org.kms.pojo.Dictionary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/Dictionary")
@CrossOrigin(value = "*")
public class dictionary {
    @Autowired
    private dicDao dicDao;
    @Autowired
    private dictionaryDao dictionaryDao;

    @RequestMapping("/index")
    @ResponseBody
    public List<Dictionary> getall() throws Exception{
        return dicDao.getbyname("学期类型");
    }
    @RequestMapping("/index2")
    @ResponseBody
    public List<Dictionary> getall2() throws Exception{
        return dicDao.getbyname("审批意见");
    }

    @RequestMapping("/all")
    @ResponseBody
    public List<Dictionary> all() throws Exception{
        return  dictionaryDao.getAll();
    }

    @RequestMapping("/list")
    @ResponseBody
    public List<Dictionary> list() throws Exception{
        return  dictionaryDao.getsp();
    }
}
